package by.dezhits.liltweets.http;

import java.io.Serializable;

import android.net.Uri;

public class HttpRequestBuilder implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6217935723129110580L;

	public static enum Type {
		GET, POST
	}

	public static enum TwitterRequest {
		STATUSES_HOME_TIMELINE, USERS_SHOW, STATUSES_UPDATE, STATUSES_RETWEET, STATUSES_DESTROY, SEARCH_TWEETS;
	}

	private String mUrl;

	private TwitterRequest mTwitterRequest;

	private Type mType;

	public String getUrl() {
		return mUrl;
	}

	public void setUrl(String url) {
		this.mUrl = url;

	}

	public Type getType() {
		return mType;
	}

	public void setType(Type type) {
		this.mType = type;
	}

	public TwitterRequest getTwitterRequest() {
		return mTwitterRequest;
	}

	public void setTwitterRequest(TwitterRequest twitterrequest) {
		this.mTwitterRequest = twitterrequest;
	}

	public void appendQueryParameter(String key, String value) {
		Uri uri = Uri.parse(this.mUrl);
		Uri.Builder builder = uri.buildUpon();
		builder.appendQueryParameter(key, value);
		uri = builder.build();
		mUrl = uri.toString();
	}

}
